import java.io.File;
import java.io.IOException;
import java.text.ParseException;

import no.ntnu.fp.model.Watch;
import no.ntnu.fp.model.Well;
import no.ntnu.fp.storage.FileStorage;


public class TestLoadXml
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		FileStorage storage = new FileStorage();
		File dir = new File(Watch.wellPath);
		File aFile;
		
		String[] childs = dir.list();
		for(int i = 0; i < childs.length; i++)
		{
			aFile = new File(Watch.wellPath + childs[i]);
			try
			{
				Well w = storage.load(aFile);
			} catch (IllegalArgumentException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (IOException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (ParseException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
//		FileStorage storage = new FileStorage();
//		
//		File aFile = new File("C:\\Wells\\well0.xml");
//		try
//		{
//			storage.load(aFile);
//		} catch (IllegalArgumentException e)
//		{
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (IOException e)
//		{
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (ParseException e)
//		{
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}

	}

}
